package com.wangcp.service.impl;

import com.wangcp.service.AsyncService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
* 实现类
* @author wangcp
* @date 2022/01/17 15:02
**/
@Slf4j
@Service
public class AsyncServiceImpl implements AsyncService {


    @Override
    @Async("asyncServiceExecutor")
    public void executeAsync() {
        log.info("start executeAsync");

        System.out.println("异步线程要做的事情");
        System.out.println("可以在这里执行批量插入等耗时的事情");

        log.info("end executeAsync");
    }
}
